function isf = isBVQXfile(hfile, varargin)
% isBVQXfile  - check (and validate) object
%
% FORMAT:       isf = isBVQXfile(hfile [, valid])
%
% Input fields:
%
%       hfile       MxN argument check for class
%       valid       if given and true, perform validation
%
% Output fields:
%
%       isf         logical array of input size with check result

% Version:  v0.7a
% Build:    7082801
% Date:     Aug-28 2006, 1:34 AM CEST
% Author:   Jochen Weber, Brain Innovation, B.V., Maastricht, NL
% URL/Info: http://wiki.brainvoyager.com/BVQXtools

% base argument check
if nargin < 1
    error( ...
        'BVQXtools:TooFewArguments', ...
        'At least one input argument is required.' ...
    );
end
chstrict = false;
chtypest = '';
if nargin > 1 && ...
    numel(varargin{1}) == 1 && ...
   (isnumeric(varargin{1}) || ...
    islogical(varargin{1}))
    if varargin{1}
        chstrict = true;
    end
elseif nargin > 1 && ...
    ischar(varargin{1}) && ...
    ~isempty(varargin{1})
    chstrict = true;
    chtypest = varargin{1}(:)';
end

% make call
isf = BVQXfile(0, 'isobject', hfile, chstrict, chtypest);
